//
//  SearchLocation.m
//  CarLife
//
//  Created by yu on 2017/11/14.
//  Copyright © 2017年 jpas. All rights reserved.
//

#import "SearchLocation.h"
#import <AMapSearchKit/AMapSearchKit.h>

@implementation SearchLocation

+ (SearchLocation *)locationWithTip:(AMapTip *)tip city:(NSString *)city
{
    if (tip.uid.length == 0 || tip.location == nil || tip.address.length == 0) {
        return nil;
    }
    
    SearchLocation *location = [[SearchLocation alloc] init];
    location.name = tip.name;
    location.coordinate = CLLocationCoordinate2DMake(tip.location.latitude, tip.location.longitude);
    location.uid = tip.uid;
    location.city = city;
    location.address = tip.address;
    location.district = tip.district;
    
    return location;
}

@end
